@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">

            <input type="hidden" id="id" value="">

            <div class="row">
                <div class="col-sm-12" id="itemsArea">
                    <input type="hidden" id="itemSize" value="${subDicts.~size!0}" />
                    <div class="form-group">
                        <label class="col-sm-2 control-label">字典名称</label>
                        <div class="col-sm-2">
                            <input class="form-control" id="dictName" type="text" value="${dict.name}">
                            <input type="hidden" id="dictId" value="${dict.id}">
                        </div>
                        <div class="col-sm-2">
                            <#button btnCss="info" name="增加" icon="fa-plus" clickFun="DictInfoDlg.addItem()"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    @for(item in subDicts){
                        <div class="form-group" name="dictItem" id="dictItem${itemLP.index}">
                            <label class="col-sm-2 control-label">值</label>
                            <div class="col-sm-2">
                                <input class="form-control" type="text" name="itemNum" value="${item.num}">
                            </div>
                            <label class="col-sm-2 control-label" style="width: 8%;">名称</label>
                            <div class="col-sm-2">
                                <input class="form-control" type="text" name="itemName" value="${item.name}">
                            </div>
                            <div class="col-sm-4">
                                <#button btnCss="danger" name="删除" id="cancel" icon="fa-remove" clickFun="DictInfoDlg.deleteItem(event)"/>
                            </div>
                        </div>
                    @}
                </input>
            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="DictInfoDlg.editSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="DictInfoDlg.close()"/>
                </div>
            </div>
        </div>
    </div>

    <script type="text/template" id="itemTemplate">
        <div class="form-group" name="dictItem" id="dictItem">
            <label class="col-sm-2 control-label">值</label>
            <div class="col-sm-2">
                <input class="form-control" type="text" name="itemNum">
            </div>
            <label class="col-sm-2 control-label" style="width: 8%;">名称</label>
            <div class="col-sm-2">
                <input class="form-control" type="text" name="itemName">
            </div>
            <div class="col-sm-4">
                <#button btnCss="danger" name="删除" id="cancel" icon="fa-remove" clickFun="DictInfoDlg.deleteItem(event)"/>
            </div>
        </div>
    </script>

    <script src="${ctxPath}/static/modular/system/dict/dict_info.js"></script>
@}